package HomeWOrk2;

import java.util.Objects;

public class Studentt {
    private String name;
    private int Chinese;
    private int math;
    private int English;

    public Studentt() {
    }

    public Studentt(String name, int chinese, int math, int english) {
        this.name = name;
        Chinese = chinese;
        this.math = math;
        English = english;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getChinese() {
        return Chinese;
    }

    public void setChinese(int chinese) {
        Chinese = chinese;
    }

    public int getMath() {
        return math;
    }

    public void setMath(int math) {
        this.math = math;
    }

    public int getEnglish() {
        return English;
    }

    public void setEnglish(int english) {
        English = english;
    }

    @Override
    public String toString() {
        return "Studentt{" +
                "name='" + name + '\'' +
                ", Chinese=" + Chinese +
                ", math=" + math +
                ", English=" + English +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Studentt studentt = (Studentt) o;
        return Chinese == studentt.Chinese &&
                math == studentt.math &&
                English == studentt.English &&
                Objects.equals(name, studentt.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, Chinese, math, English);
    }
}
